home *** CD-ROM | disk | FTP | other *** search
- {
- [Scriptsettings]
- Scriptname=Demonstrate how to make event hooks
- ExecuteOnStartup=0
- ExecuteOnlyOnce=1
- RequiresOwnScripterInstance=1
- }
- program EventDemo;
-
- procedure EditorMouseUp(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
- begin
- If Button = mbRight then
- ShowMessage('You just clicked the right mousebutton!');
- end;
-
- procedure EditorKeyPress(Sender: TObject; Key: char);
- begin
- If Key = 'w' then
- ShowMessage('You just pressed the "w" key!');
- end;
-
- begin
- Editor.OnMouseUp := 'EditorMouseUp';
- Editor.OnKeyPress := 'EditorKeyPress';
- ShowMessage('Events have been assigned. Try clicing in the editor area with the right mousebutton, or pressing the "w" key.');
- ShowMessage('Select "Unhook script events" from the Scripts menu, to disable this.');
- end;
-